package com.example.demo.repository;

import com.example.demo.pojo.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;



@Service
public class UserServiceImpl extends UserService {

    @Autowired
    private UserRepository userRepository; // 注入 UserRepository

    @Override
    public Optional<User> findByUsername(String username) {
        return userRepository.findByUsername(username); // 调用 Repository 方法
    }
}
